/*
 * XML Type:  ResponseType
 * Namespace: http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd
 * Java type: cgl.narada.wsinfra.schemas.wsr.ResponseType
 *
 * Automatically generated - do not modify.
 */
package cgl.narada.wsinfra.schemas.wsr.impl;
/**
 * An XML ResponseType(@http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd).
 *
 * This is a complex type.
 */
public class ResponseTypeImpl extends cgl.narada.wsinfra.schemas.wsr.impl.HeaderBaseTypeImpl implements cgl.narada.wsinfra.schemas.wsr.ResponseType
{
    
    public ResponseTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName NONSEQUENCEREPLY$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd", "NonSequenceReply");
    private static final javax.xml.namespace.QName SEQUENCEREPLIES$2 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd", "SequenceReplies");
    
    
    /**
     * Gets array of all "NonSequenceReply" elements
     */
    public cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType[] getNonSequenceReplyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(NONSEQUENCEREPLY$0, targetList);
            cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType[] result = new cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "NonSequenceReply" element
     */
    public cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType getNonSequenceReplyArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType)get_store().find_element_user(NONSEQUENCEREPLY$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "NonSequenceReply" element
     */
    public int sizeOfNonSequenceReplyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(NONSEQUENCEREPLY$0);
        }
    }
    
    /**
     * Sets array of all "NonSequenceReply" element
     */
    public void setNonSequenceReplyArray(cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType[] nonSequenceReplyArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(nonSequenceReplyArray, NONSEQUENCEREPLY$0);
        }
    }
    
    /**
     * Sets ith "NonSequenceReply" element
     */
    public void setNonSequenceReplyArray(int i, cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType nonSequenceReply)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType)get_store().find_element_user(NONSEQUENCEREPLY$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(nonSequenceReply);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "NonSequenceReply" element
     */
    public cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType insertNewNonSequenceReply(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType)get_store().insert_element_user(NONSEQUENCEREPLY$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "NonSequenceReply" element
     */
    public cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType addNewNonSequenceReply()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.NonSequenceReplyType)get_store().add_element_user(NONSEQUENCEREPLY$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "NonSequenceReply" element
     */
    public void removeNonSequenceReply(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(NONSEQUENCEREPLY$0, i);
        }
    }
    
    /**
     * Gets array of all "SequenceReplies" elements
     */
    public cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType[] getSequenceRepliesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(SEQUENCEREPLIES$2, targetList);
            cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType[] result = new cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "SequenceReplies" element
     */
    public cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType getSequenceRepliesArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType)get_store().find_element_user(SEQUENCEREPLIES$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "SequenceReplies" element
     */
    public int sizeOfSequenceRepliesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SEQUENCEREPLIES$2);
        }
    }
    
    /**
     * Sets array of all "SequenceReplies" element
     */
    public void setSequenceRepliesArray(cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType[] sequenceRepliesArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(sequenceRepliesArray, SEQUENCEREPLIES$2);
        }
    }
    
    /**
     * Sets ith "SequenceReplies" element
     */
    public void setSequenceRepliesArray(int i, cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType sequenceReplies)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType)get_store().find_element_user(SEQUENCEREPLIES$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(sequenceReplies);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "SequenceReplies" element
     */
    public cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType insertNewSequenceReplies(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType)get_store().insert_element_user(SEQUENCEREPLIES$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "SequenceReplies" element
     */
    public cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType addNewSequenceReplies()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType target = null;
            target = (cgl.narada.wsinfra.schemas.wsr.SequenceRepliesType)get_store().add_element_user(SEQUENCEREPLIES$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "SequenceReplies" element
     */
    public void removeSequenceReplies(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SEQUENCEREPLIES$2, i);
        }
    }
}
